package string;

public class ReplaceAllDemo {
    public static void main(String[] args) {
        String line = "abc123def456ghi";
        // 将当前字符串中的数字部分替换成#NUMBER#
        String newLine = line.replaceAll("[0-9]+", "#NUMBER#");
        System.out.println(newLine);

        String regex = "(wqnmlgb|cnm|dsb|nc|wrsndm|fw|djb)";
        String message = "wqnmlgb！你个dsb！你怎么这么的nc,会不会玩！你个djb！";
        message = message.replaceAll(regex, "***");
        System.out.println(message);

    }
}
